<template>
    <div class="app-container">
        <el-row :gutter="20">
            <splitpanes :horizontal="this.$store.getters.device === 'mobile'" class="default-theme">

                <pane size="84">

                    <el-col>
                        <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch">
                            <el-form-item label="姓名" prop="name">
                                <el-input v-model="queryParams.name" placeholder="请输入登记人姓名" clearable
                                    @keyup.enter.native="handleQuery" />
                            </el-form-item>
                            <el-form-item label="工号" prop="workNo">
                                <el-input v-model="queryParams.workNo" placeholder="请输入登记人工号" clearable
                                    @keyup.enter.native="handleQuery" />
                            </el-form-item>
                            <el-form-item label="合同号" prop="orderNo">
                                <el-input v-model="queryParams.orderNo" placeholder="请输入合同号" clearable
                                    @keyup.enter.native="handleQuery" />
                            </el-form-item>
                            <el-form-item label="工序" prop="procedure">
                                <el-select v-model="queryParams.procedure" placeholder="请选择工序" @change="handleQuery">
                                    <el-option label="刷花" value="刷花"></el-option>
                                    <el-option label="订花" value="订花"></el-option>
                                    <el-option label="冲花" value="冲花"></el-option>
                                    <el-option label="贴花" value="贴花"></el-option>
                                    <el-option label="成型" value="成型"></el-option>
                                    <el-option label="磨边" value="磨边"></el-option>
                                    <el-option label="磨孔" value="磨孔"></el-option>
                                    <el-option label="抛光" value="抛光"></el-option>
                                    <el-option label="包装" value="包装"></el-option>

                                </el-select>
                            </el-form-item>

                            <el-form-item label="记录日期">


                                <el-date-picker type="daterange" v-model="queryParams.redistDate" range-separator="至"
                                    start-placeholder="开始日期" end-placeholder="结束日期" clearable style="width: 240px" />
                            </el-form-item>

                            <el-form-item label="完成日期">

                                <el-date-picker type="daterange" v-model="queryParams.taskDate" range-separator="至"
                                    start-placeholder="开始日期" end-placeholder="结束日期" clearable style="width: 185px" />
                            </el-form-item>



                            <el-form-item>
                                <el-button type="primary" icon="el-icon-search" size="mini"
                                    @click="handleQuery">搜索</el-button>
                                <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
                            </el-form-item>
                        </el-form>

                        <el-row :gutter="10" class="mb8">
                            <el-col :span="1.5">
                                <el-button type="primary" plain icon="el-icon-plus" size="mini"
                                    @click="handleAdd">新增</el-button>
                            </el-col>
                            <!-- <el-col :span="1.5">
                <el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single"
                  @click="handleUpdate">修改</el-button>
              </el-col> -->
                            <!-- <el-col :span="1.5">
                                <el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple"
                                    @click="handleDelete">删除</el-button>
                            </el-col> -->
                            <el-col :span="1.5">
                                <el-button type="warning" plain icon="el-icon-download" size="mini"
                                    @click="handleExport">导出</el-button>
                            </el-col>
                            <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
                        </el-row>

                        <el-table :data="detailedData" v-loading="loading" @selection-change="handleSelectionChange">
                            <el-table-column type="selection" width="55" align="center" />
                            <el-table-column prop="redistDate" align="center" label="登记日期" />
                            <el-table-column align="center" label="工序" prop="procedure" />
                            <el-table-column align="center" label="工号" prop="workNo" />
                            <el-table-column align="center" label="姓名" prop="name" />
                            <el-table-column align="center" label="合同号" prop="orderNo" />
                            <el-table-column align="center" label="产品代号" prop="ProductNo" />
                            <el-table-column align="center" label="花色" prop="design" />
                            <el-table-column align="center" label="版号" prop="edition" />
                            <el-table-column align="center" label="一出几" prop="grindingNumber" />
                            <el-table-column align="center" label="几个版号" prop="editionNumber" />
                            <el-table-column align="center" label="领用数量" prop="receiveNumber" />
                            <el-table-column align="center" label="合格数量" prop="qualifiedNumber" />
                            <el-table-column align="center" label="张数" prop="sheet" />
                            <el-table-column align="center" label="二等品" prop="seconds" />
                            <el-table-column align="center" label="成品率" prop="Yield" />
                            <el-table-column align="center" label="单价" prop="unitPrice" />
                            <el-table-column align="center" label="工资" prop="wages" />
                            <el-table-column align="center" label="完成时间" prop="taskDate" />
                            <el-table-column align="center" label="备注" prop="notes" />
                            <el-table-column align="center" label="超时" prop="timeout" />
                            <el-table-column label="操作" align="center" width="150px" fixed="right">
                                <template slot-scope="scope">
                                    <el-button size="mini" type="text" icon="el-icon-edit"
                                        @click="handleUpdate(scope.row)">修改</el-button>
                                    <el-button size="mini" type="text" icon="el-icon-delete"
                                        @click="handleDelete(scope.row)">删除</el-button>
                                </template>
                            </el-table-column>
                        </el-table>

                        <pagination :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
                            @pagination="getList" />

                    </el-col>
                </pane>
            </splitpanes>
        </el-row>
        <el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body>
            <el-form ref="form" :model="form" :rules="rules" label-width="100px">
                <el-row>
                    <!-- <el-col :span="8">
                        <el-form-item label="仓库" prop="warehouse">
                            <el-select v-model="form.warehouse" style="width: 240px;" :disabled="isEdit"
                                placeholder="请选择仓库">
                                <el-option value="仓库1" label="仓库1" />
                                <el-option value="仓库2" label="仓库2" />
                            </el-select>
                        </el-form-item>
                    </el-col> -->
                    <el-col :span="8">
                        <el-form-item label="记录日期" prop="redistDate">
                            <el-date-picker style="width: 240px;" type="date" placeholder="选择记录日期"
                                v-model="form.redistDate"></el-date-picker>
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="工序" prop="procedure">
                            <el-select v-model="form.procedure" style="width: 240px;" placeholder="请选择工序">
                                <el-option label="刷花" value="刷花"></el-option>
                                <el-option label="订花" value="订花"></el-option>
                                <el-option label="冲花" value="冲花"></el-option>
                                <el-option label="贴花" value="贴花"></el-option>
                                <el-option label="成型" value="成型"></el-option>
                                <el-option label="磨边" value="磨边"></el-option>
                                <el-option label="磨孔" value="磨孔"></el-option>
                                <el-option label="抛光" value="抛光"></el-option>
                                <el-option label="包装" value="包装"></el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>

                    <el-col :span="8">
                        <el-form-item label="工号" prop="workNo">
                            <el-input v-model="form.workNo" placeholder="请输入登记人工号" />
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="名称" prop="name">
                            <el-input v-model="form.name" placeholder="请输入登记人姓名" />
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="合同号" prop="orderNo">
                            <el-input v-model="form.orderNo" placeholder="请输入合同号" />
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="产品代号" prop="ProductNo">
                            <el-input v-model="form.ProductNo" placeholder="请输入产品代号" />
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="花色" prop="design">
                            <el-input v-model="form.design" placeholder="请输入花色" />
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="版号" prop="edition">
                            <el-input v-model="form.edition" placeholder="请输入版号" />
                        </el-form-item>
                    </el-col>
                </el-row>

                <el-row>


                    <el-col :span="8">
                        <el-form-item label="一出几" prop="grindingNumber">
                            <el-input v-model="form.grindingNumber" placeholder="请输入一出几" />
                        </el-form-item>
                    </el-col>

                    <el-col :span="8">
                        <el-form-item label="几个版号" prop="editionNumber">
                            <el-input v-model="form.editionNumber" placeholder="请输入几个版号" />
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="领用数量" prop="receiveNumber">
                            <el-input v-model="form.receiveNumber" placeholder="请输入领用数量" />
                        </el-form-item>
                    </el-col>
                </el-row>


                <el-row>
                    <el-col :span="8">
                        <el-form-item label="合格数量" prop="qualifiedNumber">
                            <el-input v-model="form.qualifiedNumber" placeholder="请输入合格数量" />
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="张数" prop="sheet">
                            <el-input v-model="form.sheet" placeholder="请输入张数" />
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="二等品" prop="seconds">
                            <el-input v-model="form.seconds" placeholder="请输入二等品数量" />
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="8">
                        <el-form-item label="成品率" prop="Yield">
                            <el-input v-model="form.Yield" placeholder="请输入成品率" />
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="单价" prop="unitPrice">
                            <el-input v-model="form.unitPrice" placeholder="请输入单价" />
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="工资" prop="wages">
                            <el-input v-model="form.wages" placeholder="请输入工资" />
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="8">
                        <el-form-item label="完成时间" prop="taskDate">
                            <el-date-picker style="width: 240px;" type="date" placeholder="选择完成日期"
                                v-model="form.taskDate"></el-date-picker>
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="备注" prop="notes">
                            <el-input v-model="form.notes" placeholder="请输入备注" />
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="是否超时" prop="timeout">
                            <el-select v-model="form.timeout" style="width: 240px;" placeholder="请选择是否超时">
                                <el-option label="True" value="True"></el-option>
                                <el-option label="Flase" value="False"></el-option>

                            </el-select>
                        </el-form-item>
                    </el-col>
                </el-row>
            </el-form>
            <div slot="footer" class="dialog-footer">
                <el-button type="primary" @click="submitForm">确 定</el-button>
                <el-button @click="cancel">取 消</el-button>
            </div>
        </el-dialog>
    </div>
</template>

<script>
import { Splitpanes, Pane } from "splitpanes";
import "splitpanes/dist/splitpanes.css";
export default {
    components: { Splitpanes, Pane },
    data() {
        return {
            // 标题
            title: null,
            // 总条数
            total: 0,
            // 打开弹出框
            open: false,
            // 表格
            form: {},
            // 校验
            rules: {},

            detailedData: [{
                "redistDate": "2025-3-19",
                "procedure": "冲花",
                "workNo": "29527",
                "name": "杨丽金",
                "orderNo": "241206",
                "ProductNo": "HZ-TL20912",
                "design": "5710#A",
                "edition": "",
                "grindingNumber": "3",
                "editionNumber": "1",
                "receiveNumber": "1430",
                "qualifiedNumber": "1430",
                "sheet": "",
                "seconds": "",
                "Yield": "1",
                "unitPrice": "0.018",
                "wages": "25.74",
                "taskDate": "2025-3-19",
                "notes": "碗条",
                "timeout": "False"
            }, {
                "redistDate": "2025-3-19",
                "procedure": "刷花",
                "workNo": "15820",
                "name": "潘华美",
                "orderNo": "25YB0203",
                "ProductNo": "HZ-YL012720",
                "design": "4005#",
                "edition": "三0731#",
                "grindingNumber": "1",
                "editionNumber": "1",
                "receiveNumber": "340",
                "qualifiedNumber": "340",
                "sheet": "340",
                "seconds": "",
                "Yield": "1",
                "unitPrice": "0.035",
                "wages": "11.9",
                "taskDate": "2025-3-19",
                "notes": "底花",
                "timeout": "False"
            }, {
                "redistDate": "2025-3-19",
                "procedure": "夹花",
                "workNo": "29535",
                "name": "左双芬",
                "orderNo": "25YB0203",
                "ProductNo": "HZ-YL012720",
                "design": "4005#",
                "edition": "三0731#",
                "grindingNumber": "1",
                "editionNumber": "1",
                "receiveNumber": "340",
                "qualifiedNumber": "340",
                "sheet": "340",
                "seconds": "",
                "Yield": "1",
                "unitPrice": "0.022",
                "wages": "7.48",
                "taskDate": "2025-3-19",
                "notes": "底花",
                "timeout": "False"
            }],

            parentAccountName: [{
                label: '客户所在地区列表',
                children: [{
                    label: '国内',
                    children: [{
                        label: '山东'
                    }, {
                        label: '辽宁'
                    }, {
                        label: '吉林'
                    }, {
                        label: '大连'
                    }, {
                        label: '鞍山'
                    }, {
                        label: '本溪'
                    }]
                }, {
                    label: '国外',
                    children: [{
                        label: '日本'
                    }, {
                        label: '英国'
                    }, {
                        label: '美国'
                    }, {
                        label: '泰国'
                    }]

                }]
            }],

            defaultProps: {
                children: 'children',
                label: 'label'
            },
            queryParams: {
                pageNum: 1,
                pageSize: 10,
            },
            showSearch: true,
            single: false,
            multiple: false,
            tableData: [],
            tableData1: [{
                label: '原材料',
                children: [{
                    编号: '0103010025',
                    代号: 'HZ-BF3064037',
                    品名: 'BF3064037花纸',
                    类别: '花纸',
                    主单位: '张',
                    副单位: '米',
                    转换率: '1:1',
                    货位: 'A1',
                    是否需要货位: '是',
                    ABC编码: 'A101',
                    批号: '20210101',
                    条形码: '123456789012',
                    来源: '自制',
                    是否管制: '否',
                    重量单位: '克',
                    单位重量: '1000',
                    体积单位: '立方米',
                    单位体积: '1',
                    保质天数: '30',
                    安全库存: '1000',
                    最小库存: '0',
                    最大库存: '100000',
                    最少库存金额: '0',
                    最大库存金额: '100000000',
                    税率: '0.13',
                    采购方式: '按单采购',
                    采购提前期: '1',
                    生产提前期: '1',
                    价格: '100',
                    状态: '正在使用',

                }, {
                    编号: '0103010026',
                    代号: 'HZ-BF3064038',
                    品名: 'BF3064038花纸',
                    类别: '花纸',
                    主单位: '张',
                    副单位: '米',
                    转换率: '1:1',
                    货位: 'A1',
                    是否需要货位: '是',
                    ABC编码: 'A101',
                    批号: '20210101',
                    条形码: '123456789012',
                    来源: '自制',
                    是否管制: '否',
                    重量单位: '克',
                    单位重量: '1000',
                    体积单位: '立方米',
                    单位体积: '1',
                    保质天数: '30',
                    安全库存: '1000',
                    最小库存: '0',
                    最大库存: '100000',
                    最少库存金额: '0',
                    最大库存金额: '100000000',
                    税率: '0.13',
                    采购方式: '按单采购',
                    采购提前期: '1',
                    生产提前期: '1',
                    价格: '100',
                    状态: '正在使用',
                }, {
                    编号: '0103010027',
                    代号: 'HZ-BF3064039',
                    品名: 'BF3064039花纸',
                    类别: '花纸',
                    主单位: '张',
                    副单位: '米',
                    转换率: '1:1',
                    货位: 'A1',
                    是否需要货位: '是',
                    ABC编码: 'A101',
                    批号: '20210101',
                    条形码: '123456789012',
                    来源: '自制',
                    是否管制: '否',
                    重量单位: '克',
                    单位重量: '1000',
                    体积单位: '立方米',
                    单位体积: '1',
                    保质天数: '30',
                    安全库存: '1000',
                    最小库存: '0',
                    最大库存: '100000',
                    最少库存金额: '0',
                    最大库存金额: '100000000',
                    税率: '0.13',
                    采购方式: '按单采购',
                    采购提前期: '1',
                    生产提前期: '1',
                    价格: '100',
                    状态: '正在使用',
                }]
            }, {
                label: '辅料类',
                children: [{
                    编号: '02032896',
                    代号: 'HZ-A101',
                    品名: 'BF325085胶带',
                    类别: '辅料',
                    主单位: '个',
                    副单位: '米',
                    转换率: '1:1',
                    货位: 'A1',
                    是否需要货位: '是',
                    ABC编码: 'A101',
                    批号: '20210101',
                    条形码: '123456789012',
                    来源: '自制',
                    是否管制: '否',
                    重量单位: '克',
                    单位重量: '1000',
                    体积单位: '立方米',
                    单位体积: '1',
                    保质天数: '30',
                    安全库存: '1000',
                    最小库存: '0',
                    最大库存: '100000',
                    最少库存金额: '0',
                    最大库存金额: '100000000',
                    税率: '0.13',
                    采购方式: '按单采购',
                    采购提前期: '1',
                    生产提前期: '1',
                    价格: '100',
                    状态: '正在使用',
                    包装数: '1000',
                    // 来源: '自制',
                }, {
                    编号: '02032897',
                    代号: 'HZ-A102',
                    品名: 'BF325086胶带',
                    类别: '辅料',
                    主单位: '个',
                    副单位: '米',
                    转换率: '1:1',
                    货位: 'A1',
                    是否需要货位: '是',
                    ABC编码: 'A101',
                    批号: '20210101',
                    条形码: '123456789012',
                    来源: '自制',
                    是否管制: '否',
                    重量单位: '克',
                    单位重量: '1000',
                    体积单位: '立方米',
                    单位体积: '1',
                    保质天数: '30',
                    安全库存: '1000',
                    最小库存: '0',
                    最大库存: '100000',
                    最少库存金额: '0',
                    最大库存金额: '100000000',
                    税率: '0.13',
                    采购方式: '按单采购',
                    采购提前期: '1',
                    生产提前期: '1',
                    价格: '100',
                    状态: '正在使用',
                    包装数: '1000',
                }, {
                    编号: '02032898',
                    代号: 'HZ-A103',
                    品名: 'BF325087胶带',
                    类别: '辅料',
                    主单位: '个',
                    副单位: '米',
                    转换率: '1:1',
                    货位: 'A1',
                    是否需要货位: '是',
                    ABC编码: 'A101',
                    批号: '20210101',
                    条形码: '123456789012',
                    来源: '自制',
                    是否管制: '否',
                    重量单位: '克',
                    单位重量: '1000',
                    体积单位: '立方米',
                    单位体积: '1',
                    保质天数: '30',
                    安全库存: '1000',
                    最小库存: '0',
                    最大库存: '100000',
                    最少库存金额: '0',
                    最大库存金额: '100000000',
                    税率: '0.13',
                    采购方式: '按单采购',
                    采购提前期: '1',
                    生产提前期: '1',
                    价格: '100',
                    状态: '正在使用',
                    包装数: '1000',
                }]
            }, {
                label: '半成品类',
                children: [{
                    编号: '03032896',
                    代号: 'HZ-A101',
                    品名: '汤碗',
                    类别: '半成品',
                    主单位: '个',
                    副单位: '米',
                    转换率: '1:1',
                    货位: 'A1',
                    是否需要货位: '是',
                    ABC编码: 'A101',
                    批号: '20210101',
                    条形码: '123456789012',
                    来源: '自制',
                    是否管制: '否',
                    重量单位: '克',
                    单位重量: '1000',
                    体积单位: '立方米',
                    单位体积: '1',
                    保质天数: '30',
                    安全库存: '1000',
                    最小库存: '0',
                    最大库存: '100000',
                    最少库存金额: '0',
                    最大库存金额: '100000000',
                    税率: '0.13',
                    采购方式: '按单采购',
                    采购提前期: '1',
                    生产提前期: '1',
                    价格: '100',
                    状态: '正在使用',
                    包装数: '1000',
                    // 来源: '自制',
                }, {
                    编号: '03032897',
                    代号: 'HZ-A102',
                    品名: '汤碗',
                    类别: '半成品',
                    主单位: '个',
                    副单位: '米',
                    转换率: '1:1',
                    货位: 'A1',
                    是否需要货位: '是',
                    ABC编码: 'A101',
                    批号: '20210101',
                    条形码: '123456789012',
                    来源: '自制',
                    是否管制: '否',
                    重量单位: '克',
                    单位重量: '1000',
                    体积单位: '立方米',
                    单位体积: '1',
                    保质天数: '30',
                    安全库存: '1000',
                    最小库存: '0',
                    最大库存: '100000',
                    最少库存金额: '0',
                    最大库存金额: '100000000',
                    税率: '0.13',
                    采购方式: '按单采购',
                    采购提前期: '1',
                    生产提前期: '1',
                    价格: '100',
                    状态: '正在使用',
                    包装数: '1000',
                }]
            },
            {
                label: '成品类'
            },
            {
                label: '其他类'
            },
            {
                label: '设备类'
            },
            {
                label: '模具类'
            }],
            loading: false,
            ids: [],
            isShow1: false,
            isShow2: false,
            isShow3: false,
            isShow4: false,
            isShow5: false,
            isShow6: false,
        }
    },
    // mounted() {
    //   this.handleNodeClick(this.parentAccountName[0].children[0])
    // },
    // methods: {
    //   filterNode(value, data) {
    //     if (!value) return true;
    //     return data.label.indexOf(value) !== -1;
    //   },
    //   handleNodeClick(data) {
    //     if (data.label === '原材料') {
    //       this.tableData = this.tableData1[0].children;
    //       this.isShow1 = false;
    //       this.isShow2 = false;
    //       this.isShow3 = false;
    //       this.isShow4 = false;
    //       this.isShow5 = false;
    //       this.isShow6 = false;
    //     } else if (data.label === '辅料类') {
    //       this.tableData = this.tableData1[1].children;
    //       this.isShow1 = false;
    //       this.isShow2 = false;
    //       this.isShow3 = false;
    //       this.isShow4 = true;
    //       this.isShow5 = false;
    //       this.isShow6 = false;
    //     } else if (data.label === '半成品类') {
    //       this.tableData = this.tableData1[2].children;
    //       this.isShow1 = false;
    //       this.isShow2 = true;
    //       this.isShow3 = false;
    //       this.isShow4 = false;
    //       this.isShow5 = false;
    //       this.isShow6 = false;
    //     } else if (data.label === '成品类') {
    //       this.tableData = this.tableData1[3].children;
    //       this.isShow1 = false;
    //       this.isShow2 = false;
    //       this.isShow3 = true;
    //       this.isShow4 = false;
    //       this.isShow5 = false;
    //       this.isShow6 = false;
    //     } else if (data.label === '其他类') {
    //       this.tableData = this.tableData1[4].children;
    //       this.isShow1 = false;
    //       this.isShow2 = false;
    //       this.isShow3 = false;
    //       this.isShow4 = true;
    //       this.isShow5 = false;
    //       this.isShow6 = false;
    //     } else if (data.label === '设备类') {
    //       this.tableData = this.tableData1[5].children;
    //       this.isShow1 = false;
    //       this.isShow2 = false;
    //       this.isShow3 = false;
    //       this.isShow4 = false;
    //       this.isShow5 = true;
    //       this.isShow6 = false;
    //     } else if (data.label === '模具类') {
    //       this.tableData = this.tableData1[6].children;
    //       this.isShow1 = false;
    //       this.isShow2 = false;
    //       this.isShow3 = false;
    //       this.isShow4 = false;
    //       this.isShow5 = false;
    //       this.isShow6 = true;
    //     }
    //   },
    //   submitForm() {
    //     this.open = false;
    //   },
    //   cancel() { this.open = false; },
    //   handleQuery() {
    //     this.loading = false;
    //   },
    //   resetQuery() {
    //   },
    //   handleAdd() {
    //     this.title = '新增原材料'
    //     this.open = true;
    //     this.isEdit = false;
    //   },
    //   handleUpdate(row) {
    //     this.title = '编辑原材料'
    //     this.open = true;
    //     this.isEdit = false;
    //     this.form = row;
    //   },
    //   handleDelete() { },
    //   handleExport() { },
    //   handleSelectionChange(selection) {
    //     this.ids = selection.map((item) => item.userId);
    //     this.single = selection.length !== 1;
    //     this.multiple = !selection.length;
    //   },
    // },
    mounted() {
        this.handleNodeClick(this.parentAccountName[0].children[0])
    },
    methods: {
        filterNode(value, data) {
            if (!value) return true;
            return data.label.indexOf(value) !== -1;
        },
        handleNodeClick(data) {
            if (data.label === '原材料') {
                this.tableData = this.tableData1[0].children;
                this.isShow1 = false;
                this.isShow2 = false;
                this.isShow3 = false;
                this.isShow4 = false;
                this.isShow5 = false;
                this.isShow6 = false;
            } else if (data.label === '辅料类') {
                this.tableData = this.tableData1[1].children;
                this.isShow1 = false;
                this.isShow2 = false;
                this.isShow3 = false;
                this.isShow4 = true;
                this.isShow5 = false;
                this.isShow6 = false;
            } else if (data.label === '半成品类') {
                this.tableData = this.tableData1[2].children;
                this.isShow1 = false;
                this.isShow2 = true;
                this.isShow3 = false;
                this.isShow4 = false;
                this.isShow5 = false;
                this.isShow6 = false;
            } else if (data.label === '成品类') {
                this.tableData = this.tableData1[3].children;
                this.isShow1 = false;
                this.isShow2 = false;
                this.isShow3 = true;
                this.isShow4 = false;
                this.isShow5 = false;
                this.isShow6 = false;
            } else if (data.label === '其他类') {
                this.tableData = this.tableData1[4].children;
                this.isShow1 = false;
                this.isShow2 = false;
                this.isShow3 = false;
                this.isShow4 = true;
                this.isShow5 = false;
                this.isShow6 = false;
            } else if (data.label === '设备类') {
                this.tableData = this.tableData1[5].children;
                this.isShow1 = false;
                this.isShow2 = false;
                this.isShow3 = false;
                this.isShow4 = false;
                this.isShow5 = true;
                this.isShow6 = false;
            } else if (data.label === '模具类') {
                this.tableData = this.tableData1[6].children;
                this.isShow1 = false;
                this.isShow2 = false;
                this.isShow3 = false;
                this.isShow4 = false;
                this.isShow5 = false;
                this.isShow6 = true;
            }
        },
        submitForm() {
            this.open = false;
        },
        cancel() { this.open = false; },
        handleQuery() {
            this.loading = false;
        },
        resetQuery() {
        },
        handleAdd() {
            this.title = '新增自助报工登记信息'
            this.open = true;
            this.isEdit = false;
        },
        handleUpdate(row) {
            this.title = '编辑自助报工登记信息'
            this.open = true;
            this.isEdit = false;
            this.form = row;
        },
        handleDelete() { },
        handleExport() { },
        handleSelectionChange(selection) {
            this.ids = selection.map((item) => item.userId);
            this.single = selection.length !== 1;
            this.multiple = !selection.length;
        },
    },

}
</script>
